//
//  PPEmptyStateView.m
//  pickpic
//
//  Created by GaoYongyue on 16/8/27.
//  Copyright © 2016年 MicroDream. All rights reserved.
//

#import "PPEmptyStateView.h"

@interface PPEmptyStateView ()

@property (weak, nonatomic) IBOutlet UILabel *tipsLabel;

@property (weak, nonatomic) IBOutlet UIImageView *stateImageView;

@end

@implementation PPEmptyStateView

- (instancetype)init
{
    self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([PPEmptyStateView class]) owner:nil options:nil] objectAtIndex:0];
    if (self)
    {
        // Initialization code
    }
    return self;
}


- (void)awakeFromNib
{

//    self.stateTipsLabel.numberOfLines = 0;
//    self.stateTipsLabel.lineBreakMode = NSLineBreakByWordWrapping;
}


- (void)setEmptyStateData:(PPEmptyStateViewState)state noDataTips: (NSString *)noDatatips
{

    self.tipsLabel.text = @"";
    self.stateImageView.image = [UIImage imageNamed:@""];

}

- (void)showEmptyStateView:(BOOL)animated
{
    if (animated) {
        [UIView animateWithDuration:0.3 animations:^{
            self.alpha = 1.0f;
        } completion:^(BOOL finished) {
            self.hidden = NO;
        }];
    }
    else {
        self.hidden = NO;
    }
}

- (void)hideEmptyStateView:(BOOL)animated
{
    if (animated) {
        [UIView animateWithDuration:0.1 animations:^{
            self.alpha = 0.0f;
        } completion:^(BOOL finished) {
            self.hidden = YES;
        }];
    }
    else {
        self.hidden = YES;
    }
}


@end
